Definition at line 218 of file ChannelServer.h. References Impala::Util::ChannelAuthorization::AllowWrite(), ConnectionDescr(), ILOG_DEBUG, ILOG_INFO, ILOG_WARN, mAuthorization, mDoDynaPorts, mFirstDynaPort, mFirstPort, mLastDynaPort, mPortAllowWrite, mPortAssignment, and ReadQuotedString(). Referenced by AcceptRequest(). 00220 { 00221 String curCon = ConnectionDescr(); 00222 ILOG_DEBUG("Receiving port assignment request from " << curCon); 00223 if (mDoDynaPorts) 00224 { 00225 if (port == mFirstPort) 00226 { 00227 int index = 21; 00228 String writePass = ReadQuotedString(buf, index, len); 00229 00230 int dynaPort = 0; 00231 for (dynaPort = mFirstDynaPort; dynaPort <= mLastDynaPort; 00232 dynaPort++) 00233 { 00234 if (mPortAssignment[dynaPort].empty()) 00235 { 00236 ILOG_INFO("Assigning port " << dynaPort << " to " << 00237 curCon); 00238 mPortAssignment[dynaPort] = conn; 00239 mPortAllowWrite[dynaPort] = 00240 mAuthorization.AllowWrite(writePass); 00241 sprintf(buf, "PortAssigned=%i\0", dynaPort); 00242 break; 00243 } 00244 } 00245 if (dynaPort > mLastDynaPort) 00246 { 00247 ILOG_WARN("Cannot assign port: all ports are in use"); 00248 sprintf(buf, "NoPortAvailable\0"); 00249 } 00250 } 00251 else 00252 { 00253 ILOG_WARN("Invalid port assignment request from " << curCon << 00254 "; should request at port " << mFirstPort); 00255 sprintf(buf, "ERROR\0"); 00256 } 00257 } 00258 else 00259 { 00260 ILOG_WARN("No dynamic port assignment; no need for " << curCon << 00261 " to request port assignment"); 00262 sprintf(buf, "PortAssigned=%i\0", port); 00263 } 00264 }
Here is the call graph for this function:
|