/** * @brief 登陆服务器 * @return 成功0, 否则失败 */ static int EtherLogon(void) { SetKeepAlive(KEEPALIVE_FLAG_LOGONFAIL); SvrCommLineState = LINESTAT_OFF; if(UplinkLogon(UPLINKITF_ETHER)) { EtherDisconnect(); return 1; } //在线。。。 只有发送登录并且接到回应后才设置为ON PrintLog(0,"登录成功!\n"); ParaTermG.login_update_system = 1; ParaTermG.login_down_musice = 1; // UplinkLogonOut(UPLINKITF_ETHER); UplinkDeviceCheck(UPLINKITF_ETHER); Sleep(1000);// UplinkCheckVer(UPLINKITF_ETHER); Sleep(2000); SvrCommLineState = LINESTAT_ON; SetKeepAlive(KEEPALIVE_FLAG_LOGONOK); SvrCommNote(SVRNOTEID_ALARM); return 0; }
// Parses the Connection header and makes sure that request is properly terminated QTSS_Error HTTPRequest::ParseHeaders(StringParser* parser) { StrPtrLen theKeyWord; Bool16 isStreamOK; //Repeat until we get a \r\n\r\n, which signals the end of the headers while ((parser->PeekFast() != '\r') && (parser->PeekFast() != '\n')) { //First get the header identifier isStreamOK = parser->GetThru(&theKeyWord, ':'); if (!isStreamOK) { // No colon after header! fStatusCode = httpBadRequest; return QTSS_BadArgument; } if (parser->PeekFast() == ' ') { // handle space, if any isStreamOK = parser->Expect(' '); Assert(isStreamOK); } //Look up the proper header enumeration based on the header string. HTTPHeader theHeader = HTTPProtocol::GetHeader(&theKeyWord); StrPtrLen theHeaderVal; isStreamOK = parser->GetThruEOL(&theHeaderVal); if (!isStreamOK) { // No EOL after header! fStatusCode = httpBadRequest; return QTSS_BadArgument; } // If this is the connection header if ( theHeader == httpConnectionHeader ) { // Set the keep alive boolean based on the connection header value SetKeepAlive(&theHeaderVal); } // Have the header field and the value; Add value to the array // If the field is invalid (or unrecognized) just skip over gracefully if ( theHeader != httpIllegalHeader ) fFieldValues[theHeader] = theHeaderVal; } isStreamOK = parser->ExpectEOL(); Assert(isStreamOK); return QTSS_NoErr; }
/* The class */ Opal::Sip::EndPoint::EndPoint (Opal::EndPoint & _endpoint, const Ekiga::ServiceCore& _core): SIPEndPoint (_endpoint), core (_core) { /* Timeouts */ SetRetryTimeouts (500, 4000); SetMaxRetries (20); /* Update the User Agent */ SetUserAgent ("Ekiga/" PACKAGE_VERSION); /* Ready to take calls */ GetManager ().AddRouteEntry("sip:.* = pc:*"); GetManager ().AddRouteEntry("pc:.* = sip:<da>"); /* Keepalive */ PTimeInterval timeout; KeepAliveType type; GetKeepAlive (timeout, type); SetKeepAlive (timeout, KeepAliveByOPTION); }