mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	rtty: throttle the amount of data being pushed to the server
The socket died when too much data was sent too fast Fixes: WIFI-12334 Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
		
							
								
								
									
										31
									
								
								feeds/ucentral/rtty/patches/300-throttle.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								feeds/ucentral/rtty/patches/300-throttle.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| Index: rtty-7.1.4/src/rtty.c | ||||
| =================================================================== | ||||
| --- rtty-7.1.4.orig/src/rtty.c | ||||
| +++ rtty-7.1.4/src/rtty.c | ||||
| @@ -36,6 +36,8 @@ | ||||
|  #include "utils.h" | ||||
|  #include "command.h" | ||||
|   | ||||
| +#include <poll.h> | ||||
| + | ||||
|  extern int force_exit; | ||||
|  extern int connected; | ||||
|   | ||||
| @@ -84,7 +86,7 @@ static void pty_on_read(struct ev_loop * | ||||
|      struct tty *tty = container_of(w, struct tty, ior); | ||||
|      struct rtty *rtty = tty->rtty; | ||||
|      struct buffer *wb = &rtty->wb; | ||||
| -    static uint8_t buf[4096]; | ||||
| +    static uint8_t buf[32* 1024]; | ||||
|      int len; | ||||
|   | ||||
|      while (1) { | ||||
| @@ -394,6 +396,8 @@ static void on_net_write(struct ev_loop | ||||
|   | ||||
|      if (buffer_length(&rtty->wb) < 1) | ||||
|          ev_io_stop(loop, w); | ||||
| + | ||||
| +	poll(NULL, 0, 100); | ||||
|  } | ||||
|   | ||||
|  static void on_net_connected(int sock, void *arg) | ||||
		Reference in New Issue
	
	Block a user
	 John Crispin
					John Crispin