From: nishi Date: Fri, 7 Jun 2024 10:26:10 +0000 (+0000) Subject: fix modem X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=eb7325505e3ebc0932a6c44728803e59fa1e797d;p=dataworks.git fix modem git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@186 d4a5a174-5a4a-5b4b-b672-37683c10d7d5 --- diff --git a/PKGBUILD b/PKGBUILD index d520c3d..e8d7bcb 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -5,9 +5,9 @@ pkgver='0.1.0' pkgdesc='Database System' arch=('i686' 'x86_64') license=('BSD') -pkgrel='26' +pkgrel='27' makedepends=('byacc') -source=('dataworks::svn+http://sw.nishi.boats/svn/nishi-dataworks/trunk#revision=185') +source=('dataworks::svn+http://sw.nishi.boats/svn/nishi-dataworks/trunk#revision=186') sha256sums=('SKIP') build() { diff --git a/Server/hayes.c b/Server/hayes.c index 4539a7b..45e12ad 100644 --- a/Server/hayes.c +++ b/Server/hayes.c @@ -227,7 +227,15 @@ void server_loop(void) { } } -char* readline_sock(int sock) { return connected ? modem_response() : NULL; } +char* readline_sock(int sock) { + char* resp = modem_response(); + if(__dw_strcaseequ(resp, "NO CARRIER")) { + free(resp); + printf("Disconnected\n"); + connected = false; + } + return connected ? modem_response() : NULL; +} void writeline(int sock, const char* str) { char* snd = __dw_strcat(str, "\r\n"); diff --git a/Server/server.c b/Server/server.c index d85f285..59e4f62 100644 --- a/Server/server.c +++ b/Server/server.c @@ -136,6 +136,7 @@ void protocol_loop(int sock) { } else if(__dw_strcaseequ(buf, "BYE") || __dw_strcaseequ(buf, "QUIT")) { writeline(sock, "QUIT:Bye"); disconnect(sock); + break; } else if(__dw_strcaseequ(buf, "USER")) { if(auth) { } else { diff --git a/increment-PKGBUILD b/increment-PKGBUILD index f64f5d8..9902f17 100644 --- a/increment-PKGBUILD +++ b/increment-PKGBUILD @@ -1 +1 @@ -27 +28