Commit 048d5202 authored by Yury Popov's avatar Yury Popov

Code fixes

parent dd5b752d
......@@ -425,7 +425,7 @@ static void* client_proc (void* arg) {
if (len > 0) off += len;
else if (len == 0) break;
else if (len == -1) {
if (errno == 35) {
if (errno == EAGAIN) {
char bc = checkbuf(buf);
if (bc == 1) break;
if (bc == -1) {
......@@ -433,7 +433,7 @@ static void* client_proc (void* arg) {
close(sock);
pthread_exit(0);
}
if ((std::time(0) - start) > 60) {
if ((time(0) - start) > 60) {
printf("Read timeout: %d\n",sock);
close(sock);
pthread_exit(0);
......@@ -444,6 +444,8 @@ static void* client_proc (void* arg) {
printf("err %d\n",errno);
break;
}
char bc = checkbuf(buf);
if (bc == 1) break;
}
char* get = strstr(buf, "GET ");
if (get) {
......@@ -604,7 +606,7 @@ int main(int argc, const char * argv[]) {
sadr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
do {
if (bind(sock, (const struct sockaddr *)&sadr, sizeof(sadr)) == -1) {
if (errno == 48) {
if (errno == EADDRINUSE) {
printf(".");
fflush(stdout);
sleep(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment