Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
bf47e77a
Commit
bf47e77a
authored
25 years ago
by
pw
Browse files
Options
Downloads
Patches
Plain Diff
This change allows 'motifd' to correctly read a multi-packet message
from the client.
parent
88343c78
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
motif/server/message.c
+39
-10
39 additions, 10 deletions
motif/server/message.c
with
39 additions
and
10 deletions
motif/server/message.c
+
39
−
10
View file @
bf47e77a
/*
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/motif/server/message.c,v 1.
4 1997
/0
4
/1
9 20:13:24
pw Exp $
$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/motif/server/message.c,v 1.
5 2000
/0
2
/1
4 11:45:57
pw Exp $
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University, and has been placed in the public domain.
...
...
@@ -58,6 +58,8 @@ void message_add_packet(message_t message) {
void
message_insert_packet
(
message_t
message
,
packet_t
new
)
{
packet_t
scan
=
message
->
packets
;
/* Inserts in reverse order of sequence number (->current) */
if
(
!
scan
)
message
->
packets
=
new
;
else
...
...
@@ -70,7 +72,6 @@ void message_insert_packet(message_t message, packet_t new) {
new
->
next
=
scan
->
next
;
scan
->
next
=
new
;
}
message
->
packet_count
++
;
}
...
...
@@ -168,6 +169,21 @@ void kill_deferred_message(long serial) {
target
->
next
=
NULL
;
}
packet_t
nreverse_packet_list
(
packet_t
list
)
{
packet_t
this
=
list
->
next
;
packet_t
next
=
list
;
packet_t
last
=
NULL
;
while
(
this
)
{
next
->
next
=
last
;
last
=
next
;
next
=
this
;
this
=
(
this
==
list
)
?
NULL
:
this
->
next
;
}
list
->
next
=
last
;
return
last
;
}
/*
* The given packet needs to be held over and joined with it's friends.
*/
...
...
@@ -202,6 +218,7 @@ message_t message_defer_packet(packet_t packet) {
current
->
next
=
target
->
next
;
}
target
->
next
=
NULL
;
target
->
packets
=
nreverse_packet_list
(
target
->
packets
);
return
target
;
}
else
return
NULL
;
...
...
@@ -214,16 +231,28 @@ message_t message_read(int socket) {
packet_read
(
socket
,
first
);
count
=
first
->
total
;
if
(
!
count
&&
!
first
->
current
)
{
kill_deferred_message
(
first
->
serial
);
if
(
global_will_trace
)
{
printf
(
"Got cancellation for serial %d
\n
"
,
first
->
serial
);
fflush
(
stdout
);
}
}
else
if
(
count
==
1
)
{
if
(
count
==
1
)
{
new
=
message_new
(
next_serial
++
);
new
->
packets
=
first
;
new
->
packet_count
=
1
;
return
new
;
}
else
return
message_defer_packet
(
first
);
}
else
{
new
=
message_defer_packet
(
first
);
while
(
new
==
NULL
)
{
packet_t
next
=
packet_new
(
0
,
1
);
packet_read
(
socket
,
next
);
if
(
!
next
->
total
&&
!
next
->
current
)
{
/* There is no client support for getting here yet! */
kill_deferred_message
(
first
->
serial
);
if
(
global_will_trace
)
{
printf
(
"Got cancellation for serial %d
\n
"
,
first
->
serial
);
fflush
(
stdout
);
}
/* TBD now what? */
return
NULL
;
}
new
=
message_defer_packet
(
next
);
}
return
new
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment