'Can I manually make tcp zero window and drop?

I have to request specific directory repeatedly. ex) https://example.org/home/dir/aaa/11 There is case if http response status code is 200 or else. If 200? read data from raw socket&and if there is 404, drop remainder packets. ex

    int bytes_received = SSL_read(ssl, response, 1370);
    printf("%s\nreceive : %d", response, bytes_received);
    if(strstr(response, "HTTP1.1 200 OK") goto(specific behavior);
else{drop; goto(ssl_write)}; // goto first send point, I want to drop remainder packets in kernel buffer from this point.  
    puts("");

Is this possible by manually modifying Kernel, or tcp structure or size of sliding window? Or else? If can't, then why? Thx.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source