Skip to content

Commit aab1299

Browse files
author
William
committed
Merge pull request QHedgeTech#1 from frodegill/master
Do not fail when calling search() rapidly
2 parents a731ab0 + b872589 commit aab1299

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/http/http.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,22 +203,19 @@ bool HTTP::error() {
203203
if( errno == 0 )
204204
return false;
205205

206+
if( errno == EWOULDBLOCK || errno == EAGAIN )
207+
return false;
208+
206209
// Socket is already connected
207210
if( errno == EISCONN )
208211
printf("Socket is already connected\n");
209212

210-
if( errno == EWOULDBLOCK )
211-
printf("Socket EWOULDBLOCK\n");
212-
213213
if(errno == EINVAL )
214214
printf("Exception caught while reading socket - Invalid argument: _sfd = %i\n", _sockfd);
215215

216216
if( errno == ECONNREFUSED )
217217
printf("Couldn't connect, connection refused.\n");
218218

219-
if( errno == EAGAIN )
220-
printf("New error from the O_NONBLOCK flag.\n");
221-
222219
if( errno == EINPROGRESS )
223220
printf("This returns is often see for large ElasticSearch requests.\n");
224221

0 commit comments

Comments
 (0)