Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lyskom-server-ceder-1616-generations-topgit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
33dfec50
Commit
33dfec50
authored
Oct 23, 1997
by
David Byers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New file: src/server/sync.c
Minoor updates to other files
parent
e30734dc
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
278 additions
and
14 deletions
+278
-14
ChangeLog
ChangeLog
+16
-0
doc/Protocol-A.texi
doc/Protocol-A.texi
+17
-8
run-support/Makefile.in
run-support/Makefile.in
+1
-1
run-support/aux-items.conf
run-support/aux-items.conf
+2
-2
src/server/sync.c
src/server/sync.c
+239
-0
versions
versions
+3
-3
No files found.
ChangeLog
View file @
33dfec50
Mon Sep 22 19:06:05 1997 David Byers <davby@litefix.ida.liu.se>
* src/server/cache-node.h: New flags: snapshot and synced.
Sun Sep 21 21:16:28 1997 David Byers <davby@litefix.ida.liu.se>
* src/server/memory.c (copy_text_stat): Call copy_aux_item_list.
(copy_aux_item_list): New function.
(copy_aux_item): New function.
(copy_conference): Call copy_aux_item_list.
(clear_conference): Free the aux_item_list
(init_conference): Init the aux_item_list.
(clear_text_stat): Free the aux_item_list.
(init_text_stat): Init the aux_item_list.
(init_aux_item_list): New function.
Sat Sep 13 15:07:32 1997 David Byers <davby@ida.liu.se>
* run-support/aux-items.conf: New file. This is the aux-item
...
...
doc/Protocol-A.texi
View file @
33dfec50
\input
texinfo @c -*-texinfo-*-
@c
$
Id: Protocol
-
A.texi,v
1
.
5
1997
/
09
/
13
15
:
31
:
27
byers Exp
$
@c
$
Id: Protocol
-
A.texi,v
1
.
6
1997
/
10
/
23
12
:
40
:
35
byers Exp
$
@c
%**start of header
@setfilename protocol-a.info
@settitle LysKOM Protocol A
...
...
@@ -1236,7 +1236,7 @@ conference numbers can be specified.
@subsubsection Text Numbers
v
@example
Text-No ::= INT32;
Local-Text-No ::= INT32;
...
...
@@ -3913,9 +3913,9 @@ zero, the server will return an error.
@example
1 34 119 10 5
@t
{
=1 5 @
{
0 0 466 478 391 @
}}
@t
{
=1
10
5 @
{
0 0 466 478 391 @
}}
1 34 119 16 5
@t
{
=1 3 @
{
481 0 491 @
}}
@t
{
=1
16
3 @
{
481 0 491 @
}}
1 34 119 19 5
@t
{
%2 16 0}
@end example
...
...
@@ -6736,15 +6736,16 @@ text/plain, should support text/enriched and are encouraged to support
HTML.
@menu
* Reformattable Text (x-kom/text) ::
* Reformattable Text (x-kom/basic) ::
* Unreadable reformattable text (x-kom/ö) ::
* The User Area (x-kom/user-area) ::
* Conference Lists (x-kom/conflist) ::
@end menu
@node Reformattable Text (x-kom/
text), The User Area (x-kom/user-area
),, LysKOM Content Types
@node Reformattable Text (x-kom/
basic), The User Area (x-kom/ö
),, LysKOM Content Types
@section Reformattable Text
This type of content corresponds to the mime type x-kom/
text
. It is raw
This type of content corresponds to the mime type x-kom/
basic
. It is raw
text that can be reformatted by the client without ill effectes, but
that can be legibly displayed on a text terminal without formatting.
...
...
@@ -6765,7 +6766,15 @@ that matched that regexp is to be prefixed to all lines of the
paragraph.
@end itemize
@node The User Area (x-kom/user-area), Conference Lists (x-kom/conflist), Reformattable Text (x-kom/text), LysKOM Content Types
@node Unreadable reformattable text (x-kom/ö), The User Area (x-kom/user-area), Reformattable Text (x-kom/basic), LysKOM Content Types
@section Unreadable reformattable text
In this text format, paragraphs are terminated by a single newline
character. Lines may be of any length. Indentation at the beginning of
the line should be preserved.
@node The User Area (x-kom/user-area), Conference Lists (x-kom/conflist), Reformattable Text (x-kom/ö), LysKOM Content Types
@section The User Area
@node Conference Lists (x-kom/conflist), , The User Area (x-kom/user-area), LysKOM Content Types
...
...
run-support/Makefile.in
View file @
33dfec50
#
# Generated from: Makefile.src,v 1.1
0 1996/08/04 02:03:46 ceder
Exp
# Generated from: Makefile.src,v 1.1
1 1997/09/13 15:31:36 byers
Exp
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
...
...
run-support/aux-items.conf
View file @
33dfec50
#
# $Id: aux-items.conf,v 1.
1 1997/09/13 15:31:37
byers Exp $
# $Id: aux-items.conf,v 1.
2 1997/10/23 12:40:41
byers Exp $
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
...
...
@@ -66,7 +66,7 @@
{
inherit
=
false
;
inherit
-
limit
=
1
;
validate
=
"^[CTP][0-9]+
"
;
validate
=
"^[CTP][0-9]+"
;
}
...
...
src/server/sync.c
0 → 100644
View file @
33dfec50
Bool
sync_part
(
void
)
{
static
time_t
last_sync_start
=
NO_TIME
;
syncing_or_saving
=
1
;
if
(
last_sync_start
==
NO_TIME
)
{
last_sync_start
=
time
(
NULL
);
sync_state
=
sync_idle
;
}
switch
(
sync_state
)
{
case
sync_idle
:
if
(
ldifftime
(
time
(
NULL
),
last_sync_start
)
<
60
*
param
.
sync_interval
)
{
syncing_or_saving
=
0
;
return
TRUE
;
}
last_sync_start
=
time
(
NULL
);
sync_start
();
break
;
case
sync_active
:
if
(
next_conf_to_sync
<
highest_conf_no
)
{
sync_one_conf
();
}
else
if
(
next_text_to_sync
<
highest_text_no
)
{
sync_one_text
();
}
else
{
sync_finish
();
}
break
;
case
sync_wait
:
if
(
ldifftime
(
time
(
NULL
),
last_sync_start
)
<
60
*
param
.
sync_retry_interval
)
{
syncing_or_saving
=
0
;
return
TRUE
;
}
last_sync_start
=
time
(
NULL
);
sync_start
();
break
;
case
sync_error
:
log
(
"sync: error saving new file. Retrying."
);
sync_recover
();
break
;
default:
restart_kom
(
"sync: unknown state %d. I'm stumped.
\n
"
,
sync_state
)
break
;
}
if
(
file_b
!=
NULL
&&
ferror
(
file_b
)
!=
0
)
{
log
(
"sync: error saving new file. Retrying."
);
sync_state
=
sync_error
;
sync_recover
();
}
syncing_or_saving
=
0
;
return
FALSE
;
}
/*
* sync_recover
*
* This is called when syncing failed in the middle of a file.
*
* All cache nodes that have been written to disk are checked. If
* we saved a dirty copy (saved_dirty is set), and ptr is clear,
* we have to retrieve the saved copy from the failed file and set
* the dirty bit. If ptr is set, we still have to set the dirty bit,
* if saved_dirty is set.
*
* Finally, we set pos and size to saved_pos and saved_size.
*/
void
sync_recover
(
void
)
{
unsigned
long
i
;
long
pos
,
size
;
unsigned
long
recovered
;
unsigned
short
fatal
;
Cache_node
*
node
;
/*
* Read back texts from the failed file
*/
log
(
"sync: Recovering texts after save failure."
);
for
(
i
=
1
;
i
<
next_text_to_save
;
i
++
)
{
node
=
get_text_node
(
i
);
if
(
node
==
NULL
||
!
node
->
s
.
exists
)
continue
;
pos
=
node
->
pos
;
size
=
node
->
size
;
node
->
s
.
dirty
=
node
->
s
.
saved_dirty
;
node
->
s
.
snapshot
=
0
;
node
->
pos
=
node
->
saved_pos
;
node
->
size
=
node
->
saved_size
;
if
(
node
->
s
.
saved_dirty
&&
node
->
ptr
==
NULL
)
{
node
->
ptr
=
read_text_stat
(
file_b_r
,
pos
,
size
);
if
(
node
->
ptr
==
NULL
)
{
log
(
"sync: failed to recover text %d. "
"Reverting to previously saved version."
);
fatal
=
1
;
}
}
}
/*
* Read back conferences from the failed file
*/
recovered
=
0
;
log
(
"sync: Recovering conferences after save failure."
);
for
(
i
=
1
;
i
<
next_conf_to_save
;
i
++
)
{
node
=
get_conf_node
(
i
);
if
(
node
==
NULL
||
node
->
s
.
exists
)
continue
;
pos
=
node
->
pos
;
size
=
node
->
size
;
node
->
s
.
dirty
=
node
->
s
.
saved_dirty
;
node
->
s
.
snapshot
=
0
;
node
->
pos
=
node
->
saved_pos
;
node
->
size
=
node
->
saved_size
;
if
(
node
->
s
.
saved_dirty
&&
node
->
ptr
==
NULL
)
{
node
->
ptr
=
read_conf_stat
(
file_b_r
,
pos
,
size
);
if
(
node
->
ptr
==
NULL
)
{
log
(
"sync: failed to recover text %d. "
"Reverting to previously saved version."
);
fatal
=
1
;
}
}
/*
* Read back persons from the file
*/
node
=
get_pers_node
(
i
);
if
(
node
==
NULL
||
!
node
->
s
.
exists
)
continue
;
pos
=
node
->
pos
;
size
=
node
->
size
;
node
->
s
.
dirty
=
node
->
s
.
saved_dirty
;
node
->
s
.
snapshot
=
0
;
node
->
pos
=
node
->
saved_pos
;
node
->
size
=
node
->
saved_size
;
if
(
node
->
s
.
saved_dirty
&&
node
->
ptr
==
NULL
)
{
node
->
ptr
=
read_pers_stat
(
file_b_r
,
pos
,
size
);
if
(
node
->
ptr
==
NULL
)
{
log
(
"sync: failed to recover text %d. "
"Reverting to previously saved version."
);
fatal
=
1
;
}
}
}
if
(
fatal
)
{
restart_kom
(
"sync_recover: readback failed. Aborting."
);
}
sync_state
=
sync_wait
;
next_text_to_sync
=
1
;
next_conf_to_sync
=
1
;
}
void
save_one_text
(
void
)
{
Cache_node
*
node
;
node
=
get_text_node
(
next_text_to_sync
);
while
(
next_text_to_sync
<
highest_text_no
)
{
node
=
get_text_node
(
next_text_to_sync
);
if
(
node
==
NULL
||
!
node
->
s
.
exists
)
{
next_text_to_sync
+=
1
;
continue
;
}
node
->
saved_pos
=
node
->
pos
;
node
->
saved_size
=
node
->
size
;
node
->
s
.
saved_dirty
=
node
->
s
.
dirty
;
if
(
node
->
snap_shot
)
{
}
else
if
(
node
->
ptr
)
{
}
else
{
}
}
else
{
next_text_to_sync
+=
1
;
}
}
void
save_one_conf
(
void
)
{
}
void
sync_start
(
void
)
{
}
void
sync_finish
(
void
)
{
}
versions
View file @
33dfec50
# versions -- This file specifies various version numbers for lyskomd.
# $Id: versions,v 1.1
1 1996/08/03 01:29:00 ceder
Exp $
# $Id: versions,v 1.1
2 1997/10/23 12:40:34 byers
Exp $
# Copyright (C) 1994, 1995, 1996 Lysator Academic Computer Association.
#
# This file is part of the LysKOM server.
...
...
@@ -27,7 +27,7 @@
# does currently *not* introduce comments, it only looks that way.
# Version of prot-A.txt that this server implements:
PROTOCOL-A-LEVEL:
9
PROTOCOL-A-LEVEL:
10
# Name of the LysKOM server software:
SERVER-SOFTWARE: lyskomd
...
...
@@ -36,7 +36,7 @@ SERVER-SOFTWARE: lyskomd
# you make an unofficial distribution, *please* change this to
# something unique! Suggestion: suffix it with your initials,
# e.g. 1.7.0.ppp.1
SERVER-VERSION:
1.9.0
SERVER-VERSION:
2.0.0.dcb.1
# Old clients don't know how to get the version number as a string, so
# they are stuck with this old-format integer version number. This
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment