]> Nishi Git Mirror - dataworks.git/commitdiff
fix modem
authornishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 10:26:10 +0000 (10:26 +0000)
committernishi <nishi@d4a5a174-5a4a-5b4b-b672-37683c10d7d5>
Fri, 7 Jun 2024 10:26:10 +0000 (10:26 +0000)
git-svn-id: file:///raid/svn-main/nishi-dataworks/trunk@186 d4a5a174-5a4a-5b4b-b672-37683c10d7d5

PKGBUILD
Server/hayes.c
Server/server.c
increment-PKGBUILD

index d520c3d3788332b6df176a9f00bcea593acc8496..e8d7bcbda1916d72f01259a21e400328b087e6e5 100644 (file)
--- 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() {
index 4539a7b104031e9c7e8dd75922980dc95eaf34b0..45e12ad2b2a452283232ee5a8eeca77c5ea66f1d 100644 (file)
@@ -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");
index d85f285b4f1d7e203129c68e2ec41f18e8a27755..59e4f62effaedbef7b316dd5eef435c18c897172 100644 (file)
@@ -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 {
index f64f5d8d85ac0230d36724bd7e6ba351a95b4942..9902f17848a8974ab57d57999b74a63198fe6e23 100644 (file)
@@ -1 +1 @@
-27
+28