Skip to content

Commit 4afe819

Browse files
author
Chad Trabant
committed
*** empty log message ***
1 parent 6057aee commit 4afe819

File tree

6 files changed

+28
-15
lines changed

6 files changed

+28
-15
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2010.069: version 4.2
1+
2010.075: version 4.2
22
- Update libslink to 2.3 with batch mode support.
33
- Add support for batch mode, patch by Andres Heinloo/GFZ.
44

libslink/ChangeLog

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
2010.069: version 2.3
1+
2010.075: version 2.3
22
- Add BATCH mode support, patch from Andres Heinloo/GFZ.
3+
- Add protocol version check for BATCH command >= 3.1.
34
- Increase header search length and hostname resolution buffer (GFZ).
5+
- Set protocol version to 3.1.
46

57
2009.318: version 2.2c
68
- Add proper string limit for snprintf() call in sl_msr_print().

libslink/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LIB_OBJS = gswap.o unpack.o msrecord.o genutils.o strutils.o \
1212
logging.o network.o statefile.o config.o \
1313
globmatch.o slplatform.o slutils.o
1414

15-
CURRENT_VER = 1.1
16-
COMPAT_VER = 1.0
15+
CURRENT_VER = 2.3
16+
COMPAT_VER = 2.0
1717

1818
LIB_A = libslink.a
1919
LIB_SO = libslink.so.$(CURRENT_VER)

libslink/libslink.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern "C" {
3333
#include "slplatform.h"
3434

3535
#define LIBSLINK_VERSION "2.3"
36-
#define LIBSLINK_RELEASE "2010.069"
36+
#define LIBSLINK_RELEASE "2010.075"
3737

3838
#define SLRECSIZE 512 /* Mini-SEED record size */
3939
#define MAX_HEADER_SIZE 512 /* Max record header size */

libslink/network.c

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Originally based on the SeedLink interface of the modified Comserv in
1212
* SeisComP written by Andres Heinloo
1313
*
14-
* Version: 2010.069
14+
* Version: 2010.075
1515
***************************************************************************/
1616

1717
#include <stdio.h>
@@ -938,13 +938,13 @@ sl_sayhello (SLCD * slconn)
938938
char *extreply = 0;
939939

940940
/* Current capabilities:
941-
* SLPROTO:3.0 = SeedLink protocol version 3.0
941+
* SLPROTO:3.1 = SeedLink protocol version
942942
* CAP = CAPABILITIES command support
943943
* EXTREPLY = Extended reply message handling
944944
* NSWILDCARD = Network and station code wildcard support
945945
* BATCH = BATCH command mode support
946946
*/
947-
sprintf (sendstr, "CAPABILITIES SLPROTO:3.0 CAP EXTREPLY NSWILDCARD BATCH\r");
947+
sprintf (sendstr, "CAPABILITIES SLPROTO:3.1 CAP EXTREPLY NSWILDCARD BATCH\r");
948948

949949
/* Send CAPABILITIES and recv response */
950950
sl_log_r (slconn, 1, 2, "[%s] sending: %s\n", slconn->sladdr, sendstr);
@@ -995,22 +995,33 @@ sl_sayhello (SLCD * slconn)
995995
/***************************************************************************
996996
* sl_batchmode:
997997
*
998-
* Send the BATCH command
998+
* Send the BATCH command to switch the connection to batch command
999+
* mode, in this mode the server will not send acknowledgments (OK or
1000+
* ERROR) after recognized commands are submitted.
9991001
*
10001002
* Returns -1 on errors, 0 on success (regardless if the command was accepted).
10011003
* Sets slconn->batchmode accordingly.
10021004
***************************************************************************/
10031005
int
10041006
sl_batchmode (SLCD * slconn)
10051007
{
1006-
/* Enter batchmode if supported by server */
1007-
char sendstr[100]; /* A buffer for command strings */
1008-
char readbuf[100];
1008+
char sendstr[100]; /* A buffer for command strings */
1009+
char readbuf[100]; /* A buffer for server reply */
10091010
int bytesread = 0;
10101011

1011-
sprintf (sendstr, "BATCH\r");
1012+
if ( ! slconn )
1013+
return -1;
1014+
1015+
if (sl_checkversion (slconn, 3.1) < 0)
1016+
{
1017+
sl_log_r (slconn, 2, 0,
1018+
"[%s] detected SeedLink version (%.3f) does not support the BATCH command\n",
1019+
slconn->sladdr, slconn->protocol_ver);
1020+
return -1;
1021+
}
10121022

10131023
/* Send BATCH and recv response */
1024+
sprintf (sendstr, "BATCH\r");
10141025
sl_log_r (slconn, 1, 2, "[%s] sending: %s\n", slconn->sladdr, sendstr);
10151026
bytesread = sl_senddata (slconn, (void *) sendstr, strlen (sendstr), slconn->sladdr,
10161027
readbuf, sizeof (readbuf));

libslink/slutils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Written by Chad Trabant, ORFEUS/EC-Project MEREDIAN
77
*
8-
* modified: 2007.169
8+
* modified: 2010.075
99
***************************************************************************/
1010

1111
#include <stdlib.h>
@@ -765,7 +765,7 @@ update_stream (SLCD * slconn, SLpacket * slpack)
765765

766766
if ( (seqnum = sl_sequence (slpack)) == -1 )
767767
{
768-
sl_log_r (slconn, 2, 0, "update_stream(): could not determine sequence number\b");
768+
sl_log_r (slconn, 2, 0, "update_stream(): could not determine sequence number\n");
769769
return -1;
770770
}
771771

0 commit comments

Comments
 (0)