Changeset 1701


Ignore:
Timestamp:
Apr 11, 2007, 5:31:40 AM (15 years ago)
Author:
joshe
Message:

Replace the 'Nice try...' message with something more reassuring.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peerparse.h

    r1666 r1701  
    542542static inline int parseBufHeader( tr_peer_t * peer )
    543543{
     544    static uint8_t badproto_http[] =
     545"HTTP/1.0 400 Nice try...\015\012"
     546"Content-type: text/plain\015\012"
     547"\015\012";
     548    static uint8_t badproto_tinfoil[] =
     549"This is a not a rootkit or other backdoor, it's a bittorrent\015\012"
     550"client. Really. Why should you be worried, can't you read this\015\012"
     551"reassuring message? Now just listen to this social engi, er, I mean,\015\012"
     552"completely truthful statement, and go about your business. Your box is\015\012"
     553"safe and completely impregnable, the marketing hype for your OS even\015\012"
     554"says so. You can believe everything you read. Now move along, nothing\015\012"
     555"to see here.";
    544556    uint8_t * p   = peer->buf;
    545557
     
    554566           already */
    555567        peer_dbg( "GET  handshake, invalid" );
    556         tr_netSend( peer->socket, (uint8_t *) "Nice try...\r\n", 13 );
     568        if( 0 == memcmp( p, "GET ", 4 ) || 0 == memcmp( p, "HEAD", 4 ) )
     569        {
     570            tr_netSend( peer->socket, badproto_http, sizeof badproto_http - 1 );
     571        }
     572        tr_netSend( peer->socket, badproto_tinfoil, sizeof badproto_tinfoil - 1 );
    557573        return TR_ERROR;
    558574    }
Note: See TracChangeset for help on using the changeset viewer.