|
|
| version 1.1, 2011/10/04 22:37:46 | version 1.1.1.1.2.1, 2011/10/05 23:57:24 |
|---|---|
| Line 42 ConnectL3(int h, u_short id, struct sockaddr *sa, int | Line 42 ConnectL3(int h, u_short id, struct sockaddr *sa, int |
| int rlen, ret = 0; | int rlen, ret = 0; |
| u_short aid; | u_short aid; |
| struct sockaddr s; | struct sockaddr s; |
| char flg; | char flg, nl = 0; |
| u_char *buf; | u_char *buf; |
| socklen_t sl; | socklen_t sl; |
| Line 76 ConnectL3(int h, u_short id, struct sockaddr *sa, int | Line 76 ConnectL3(int h, u_short id, struct sockaddr *sa, int |
| ret = -1; | ret = -1; |
| break; | break; |
| } | } |
| /* local command handling */ | |
| if (rlen) { | |
| /* execute local command */ | |
| if (nl == 2) { | |
| switch (*buf) { | |
| case '.': | |
| Kill++; | |
| printf("\n"); | |
| VERB(1) LOG("Exit from client\n"); | |
| continue; | |
| case '~': | |
| default: | |
| nl ^= nl; | |
| /* send buffer, unknown command */ | |
| break; | |
| } | |
| } | |
| /* skip buffer and wait for local command */ | |
| if (nl == 1 && *buf == '~') { | |
| nl++; | |
| continue; | |
| } | |
| /* send buffer if detect NL */ | |
| if (*buf == 0xa || *buf == 0xd) | |
| nl = 1; | |
| else | |
| nl ^= nl; | |
| } else | |
| nl ^= nl; | |
| rlen = icmpSend(h, id, ANSH_FLG_CPOUT, buf, rlen, sa, sizeof(struct sockaddr)); | rlen = icmpSend(h, id, ANSH_FLG_CPOUT, buf, rlen, sa, sizeof(struct sockaddr)); |
| if (rlen == ANSH_FLG_ERR) { | if (rlen == ANSH_FLG_ERR) { |
| ret = -1; | ret = -1; |