Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 04-18-2019, 07:14 PM   #1
ThunderZ
New Member
 
Join Date: Feb 2013
Posts: 5
ThunderZ is on a distinguished road
Issue collecting input from blowtorch

I recently added Kavir's protocol handler to my MUD (based on SocketMUD) and for some odd reason ALL other clients work perfectly fine...except for BlowTorch(Android MUD client).

I can't figure out why but when you try to input anything into the mud from Blowtorch..Blowtorch ****s itself...freezes and eventually crashes and the phone must be rebooted or force close blowtorch.

From what I can tell it from the read_from_socket() function

Code:
bool read_from_socket(descriptor_t *dsock)
{
  int size;
  extern int errno;
  static char read_buf[MAX_PROTOCOL_BUFFER];
  read_buf[0] = '\0';

  /* check for buffer overflows, and drop connection in that case */
  size = 0;
  if (strlen(dsock->inbuf) >= sizeof(dsock->inbuf) - 10)
  {
    text_to_socket(dsock, "\n\r!!!! Input Overflow !!!!\n\r");
    return FALSE;
  }

  /* start reading from the socket */
  for (;;)
  {
    int sInput;

    sInput = read(dsock->control, read_buf + size,sizeof(read_buf) - 10 - size );

    if (sInput > 0)
    {
      size += sInput;

      if (read_buf[size-1] == '\n' || read_buf[size-1] == '\r')
        break;
    }
    else if (sInput == 0)
    {
      log_string("Read_from_socket: EOF");
      return FALSE;
    }
    else if (errno == EAGAIN)
      break;
    else
    {
      perror("Read_from_socket");
      return FALSE;
    }     
  }
  read_buf[size] = '\0';
  ProtocolInput( dsock, read_buf, size, dsock->inbuf );
  return TRUE;
}
What am I doing wrong? Help PLEASE! lol.

Edit: Specifically it seems to be an issue with the way im calling read() I think..

Code:
sInput = read(dsock->control, read_buf + size,sizeof(read_buf) - 10 - size );

Last edited by ThunderZ : 04-18-2019 at 07:18 PM. Reason: edit
ThunderZ is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 05:57 AM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2014