Skip to content

Commit 59f205c

Browse files
committed
fix bug
wrong position of if statement
1 parent 2e70312 commit 59f205c

File tree

1 file changed

+2
-3
lines changed
  • android_app/app/src/main/cpp

1 file changed

+2
-3
lines changed

android_app/app/src/main/cpp/tcp.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,14 @@ void check_tcp_socket(const struct arguments *args,
273273
write_rst(args, &s->tcp);
274274
} else {
275275
if (s->tcp.connect_sent == TCP_CONNECT_SENT) {
276-
buffer[bytes] = '\0';
276+
if (strcmp(buffer, "HTTP/1.0 200") == 0 || strcmp(buffer, "HTTP/1.1 200") == 0) {
277+
buffer[bytes] = '\0';
277278
s->tcp.connect_sent = TCP_CONNECT_ESTABLISHED;
278279
while (recv(s->socket, buffer, sizeof(buffer), 0) > 0) {}
279280
s->tcp.state = TCP_SYN_RECV;
280281
} else {
281282
write_rst(args, &s->tcp);
282283
}
283-
if (strcmp(buffer, "HTTP/1.0 200") == 0 || strcmp(buffer, "HTTP/1.1 200") == 0) {
284-
285284
}
286285
}
287286
} else {

0 commit comments

Comments
 (0)